package Lerbytes;

import java.io.IOException;
import java.io.InputStream;

import javax.imageio.ImageIO;

import org.apache.commons.fileupload.FileItem;
import org.apache.commons.io.output.ByteArrayOutputStream;

public class lerBytes {
	
	
	
	   public byte[] read(FileItem fi) throws IOException{
          ByteArrayOutputStream out = new ByteArrayOutputStream();
          InputStream is = fi.getInputStream();
          int read = 0;
         final byte[] b = new byte[1024];

          while ((read = is.read(b)) != -1) {
              out.write(b, 0, read);
          }
          return out.toByteArray();
      }
	
	

}
